﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MP_JobSiteCommandDtls.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.MP_JobSiteCommandDtls" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title></title>
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Scripts/DatePicker.js"></script>
</head>
<body>
    <form id="form1" runat="server">    
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">        
            <script type="text/javascript">
                function RowDblClick(sender, eventArgs) {
                    sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                }
                function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }
            </script>        
    </telerik:RadCodeBlock>
    
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="cmdSearch">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cmdExpand">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1"
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cmdCollapse">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadTreeView1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lblUpperText" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        Height="100%" Width="75px" Transparency="50">
        <table style="height: 100%; width: 100%" border="0">
            <tr>
                <td width="100%" align="center" valign="middle">
                    <img alt="Loading..." 
                        src="../Images/Buttons/loading.gif" 
                        style="border: 0px;" />
                </td>
            </tr>
        </table>
    </telerik:RadAjaxLoadingPanel>
                <telerik:RadGrid ID="RadGrid1" runat="server" 
                        AllowAutomaticDeletes="True" 
                        AllowFilteringByColumn="True" 
                        AllowMultiRowEdit="True" 
                        AllowMultiRowSelection="True" 
                        AllowPaging="True" 
                        AllowSorting="True" 
                        AutoGenerateColumns="False" 
                        EnableAJAX="True" 
                        EnableAJAXLoadingTemplate="True" 
                        GridLines="None" 
                        OnItemCommand="RadGrid1_ItemCommand" 
                        Width="100%"
                        Height="470px"
                        Skin="Outlook">
                    <MasterTableView 
                        AllowMultiColumnSorting="True" width="100%"
                        CellSpacing="-1" 
                        CommandItemDisplay="Top" 
                        DataKeyNames="JOB_SITE_CMD_DTLS_SEQ" 
                        InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                        NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                        <CommandItemTemplate>
                            <table width="100%">
                                <tr>
                                    <td>
                                        <asp:LinkButton ID="cmdAddNew" runat="server" CausesValidation="False" 
                                            CommandName="InitInsert"                                            
                                            Visible="<%# !RadGrid1.MasterTableView.IsItemInserted && RadGrid1.EditIndexes.Count <= 0 %>">
                                        <img style="border:0px;vertical-align:middle;" alt="" 
                                        src="../Images/Buttons/AddRecord.gif" /> เพิ่มข้อมูลใหม่</asp:LinkButton>
                                        &nbsp;&nbsp;
                                                   </td>

                                </tr>
                            </table>
                        </CommandItemTemplate>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" ItemStyle-Width="15" >
                        <ItemStyle Width="15px"></ItemStyle>
                        </telerik:GridEditCommandColumn>
                        <telerik:GridButtonColumn 
                            ButtonType="ImageButton" 
                            CommandName="Delete" 
                            ConfirmText="ลบข้อมูลที่เลือก?" 
                            Text="คลิกเพื่อลบรายการ" 
                            UniqueName="column1" 
                            ItemStyle-Width="15" 
                            ConfirmDialogType="RadWindow">
                        <ItemStyle Width="15px"></ItemStyle>
                        </telerik:GridButtonColumn>
                        <telerik:GridBoundColumn 
                            DataField="JOB_SITE_CMD_DTLS_SEQ"
                            HeaderText="JOB_SITE_CMD_DTLS_SEQ" 
                            UniqueName="JOB_SITE_CMD_DTLS_SEQ" 
                            Visible="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn 
                            DataField="JOB_SITE_CMD_SEQ"
                            HeaderText="JOB_SITE_CMD_SEQ" 
                            UniqueName="JOB_SITE_CMD_SEQ" 
                            Visible="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn 
                            DataField="JOB_SITE_SEQ"
                            HeaderText="JOB_SITE_SEQ" 
                            UniqueName="JOB_SITE_SEQ" 
                            Visible="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn 
                            DataField="DATE_START" 
                            HeaderText="วันที่มีผลบังคับ" 
                            UniqueName="DATE_START" 
                            DataFormatString="{0:dd/MM/yyyy}"
                            FilterControlWidth="100%" 
                            AutoPostBackOnFilter="true"
                            CurrentFilterFunction="Contains" 
                            ShowFilterIcon="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn 
                            DataField="FROM_REF_NO" 
                            HeaderText="รหัสหน่วยงานเดิม" 
                            UniqueName="FROM_REF_NO" 
                            FilterControlWidth="100%" 
                            AutoPostBackOnFilter="true"
                            CurrentFilterFunction="Contains" 
                            ShowFilterIcon="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn 
                            DataField="TO_REF_NO" 
                            HeaderText="รหัสหน่วยงานใหม่" 
                            UniqueName="TO_REF_NO" 
                            FilterControlWidth="100%" 
                            AutoPostBackOnFilter="true"
                            CurrentFilterFunction="Contains" 
                            ShowFilterIcon="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn 
                            DataField="FROM_JOB_SITE_NAME" 
                            HeaderText="ชื่อหน่วยงานเดิม" 
                            UniqueName="FROM_JOB_SITE_NAME" 
                            FilterControlWidth="100%" 
                            AutoPostBackOnFilter="true"
                            CurrentFilterFunction="Contains" 
                            ShowFilterIcon="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn 
                            DataField="TO_JOB_SITE_NAME" 
                            HeaderText="ชื่อหน่วยงานใหม่" 
                            UniqueName="TO_JOB_SITE_NAME" 
                            FilterControlWidth="100%" 
                            AutoPostBackOnFilter="true"
                            CurrentFilterFunction="Contains" 
                            ShowFilterIcon="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn Visible ="false"
                            DataField="FROM_UPPER_SEQ" 
                            HeaderText="หน่วยงานต้นสังกัดเดิม" 
                            UniqueName="FROM_UPPER_SEQ" 
                            FilterControlWidth="100%" 
                            AutoPostBackOnFilter="true"
                            CurrentFilterFunction="Contains" 
                            ShowFilterIcon="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn Visible ="false"
                            DataField="TO_UPPER_SEQ" 
                            HeaderText="หน่วยงานต้นสังกัดใหม่" 
                            UniqueName="TO_UPPER_SEQ" 
                            FilterControlWidth="100%" 
                            AutoPostBackOnFilter="true"
                            CurrentFilterFunction="Contains" 
                            ShowFilterIcon="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn Visible ="false"
                            DataField="FROM_UPPER_NAME" 
                            HeaderText="หน่วยงานต้นสังกัดเดิม" 
                            UniqueName="FROM_UPPER_NAME" 
                            FilterControlWidth="100%" 
                            AutoPostBackOnFilter="true"
                            CurrentFilterFunction="Contains" 
                            ShowFilterIcon="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn Visible ="false"
                            DataField="TO_UPPER_NAME" 
                            HeaderText="หน่วยงานต้นสังกัดใหม่" 
                            UniqueName="TO_UPPER_NAME" 
                            FilterControlWidth="100%" 
                            AutoPostBackOnFilter="true"
                            CurrentFilterFunction="Contains" 
                            ShowFilterIcon="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn 
                            DataField="CANCEL_TEXT" 
                            HeaderText="ยุบเลิก" 
                            UniqueName="CANCEL_TEXT" 
                            FilterControlWidth="100%" 
                            AutoPostBackOnFilter="true"
                            CurrentFilterFunction="Contains" 
                            ShowFilterIcon="False">
                        </telerik:GridBoundColumn>
         <%--               <telerik:GridCheckBoxColumn 
                            DataField="CANCEL" 
                            HeaderStyle-HorizontalAlign="Center" 
                            HeaderText="ยุบเลิก" 
                            AllowFiltering ="false"
                            UniqueName="CANCEL">
                            <HeaderStyle HorizontalAlign="Center" Width="30px" />
                            <ItemStyle HorizontalAlign="Center" />
                        </telerik:GridCheckBoxColumn>--%>
                    </Columns>
                    <EditFormSettings EditFormType="WebUserControl" 
                        UserControlName="../UserControls/MP_JobsiteCommandDtls.ascx">
                        <EditColumn UniqueName="EditCommandColumn1">
                        </EditColumn>
                    </EditFormSettings>
                        <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                    </MasterTableView>
                    <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" 
                        EnableRowHoverStyle="True" ReorderColumnsOnClient="True">
                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                        <ClientEvents OnRowDblClick="RowDblClick" />
                        <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                    </ClientSettings>
                </telerik:RadGrid>
                            <asp:Label ID="lblCmdSeq" runat="server" Visible="False"></asp:Label> 
                
                <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                    <Windows>
                    <telerik:RadWindow ID="CmdPosDtlsWindow" runat="server" 
                        Title="รายละเอียดการปรับโครงสร้าง" 
                        Height="550px"
                        Width="950px" 
                        ReloadOnShow="true" 
                        ShowContentDuringLoad="false"
                        Modal="true" />
                    </Windows>
                 </telerik:RadWindowManager>
                
    </form>
</body>
</html>
